export interface Region {
  id: number;
  name: string;
  value: number;
}
export type Regions = {
  regions: Region[];
};

export interface Server {
  id: number;
  name: string;
  value: number;
}

export type Servers = {
  servers: Server[];
};

export interface Risk {
  id: number;
  name: string;
  value: number;
}

export type Risks = {
  risks: Risk[];
};

export interface Abnormal {
  id: number;
  name: string;
  value: number;
}

export type Abnormals = {
  abnormals: Abnormal[];
};

export interface Relation {
  id: number;
  name: string;
  source: string;
  speed: string;
  target: string;
  value: number[];
}

export type Relations = {
  relations: Relation[];
};

export interface WordCloudData {
  name: string;
  value: number;
}

export type WordCloudDatas = {
  datas: WordCloudData[];
};

export interface TotalDatas {
  total: number;
  // db: number;
  // hb: number;
  // hd: number;
  // xb: number;
  // xn: number;
  // zn: number;
  [name: string]: number;
}

export const cityMap: Record<string, string> = {
  db: "东北",
  hb: "华北",
  hd: "华东",
  xb: "西北",
  xn: "西南",
  zn: "中南",
};

export interface CategoryData {
  [year: number]: Array<{ name: string; value: number }>;
}

export interface TopData {
  [year: number]: Array<{ name: string; value: number }>;
}
export interface Map {
  categoryData: CategoryData;
  colors: string[];
  topData: TopData;
  voltageLevel: number[];
}

export interface Data {
  regionData: Regions;
  totalData: TotalDatas;
  relationData: Relations;
  radarData: any[];
  mapData: Map;
  serverData: Servers;
  riskData: Risks;
  abnormalData: Abnormals;
  wordCloudData: WordCloudDatas;
}
